import {fromJS} from "immutable";
import * as contants from './constants';


// immutable.js ----facebook开发
//先引用 fromJS  将defaultState变成 immutable对象  。调用immutable 的 get set方法
 const defaultState=fromJS({
    login:false
})

export default (state=defaultState,action)=>{
    switch (action.type) {
        case contants.CHANGE_LOGIN:
           return  state.set('login',action.value);
        case contants.LOGOUT:
            return state.set('login',action.value)
        default:
            return state;
    }
}
